﻿#region Using directives

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using NetROS.Tiers.Entities;
using NetROS.Tiers.Data;

#endregion

namespace NetROS.Tiers.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="VwBlagajnaIzvjestajSaldoProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract class VwBlagajnaIzvjestajSaldoProviderBaseCore : EntityViewProviderBase<VwBlagajnaIzvjestajSaldo>
	{
		#region Custom Methods
		
		
		#region _vwBlagajnaIzvjestajSaldo_SljedeciDatum
		
		/// <summary>
		///	This method wrap the '_vwBlagajnaIzvjestajSaldo_SljedeciDatum' stored procedure. 
		/// </summary>
		/// <param name="IDBlagajne"> A <c>System.Int32?</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public IDataReader SljedeciDatum(System.Int32? @IDBlagajne)
		{
			return SljedeciDatum(null, 0, int.MaxValue , @IDBlagajne);
		}
		
		/// <summary>
		///	This method wrap the '_vwBlagajnaIzvjestajSaldo_SljedeciDatum' stored procedure. 
		/// </summary>
		/// <param name="IDBlagajne"> A <c>System.Int32?</c> instance.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public IDataReader SljedeciDatum(int start, int pageLength, System.Int32? @IDBlagajne)
		{
			return SljedeciDatum(null, start, pageLength , @IDBlagajne);
		}
				
		/// <summary>
		///	This method wrap the '_vwBlagajnaIzvjestajSaldo_SljedeciDatum' stored procedure. 
		/// </summary>
		/// <param name="IDBlagajne"> A <c>System.Int32?</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public IDataReader SljedeciDatum(TransactionManager transactionManager, System.Int32? @IDBlagajne)
		{
			return SljedeciDatum(transactionManager, 0, int.MaxValue , @IDBlagajne);
		}
		
		/// <summary>
		///	This method wrap the '_vwBlagajnaIzvjestajSaldo_SljedeciDatum' stored procedure. 
		/// </summary>
		/// <param name="IDBlagajne"> A <c>System.Int32?</c> instance.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="IDataReader"/> instance.</returns>
		public abstract IDataReader SljedeciDatum(TransactionManager transactionManager, int start, int pageLength , System.Int32? @IDBlagajne);
		
		#endregion
		
		#endregion

		#region Helper Functions
		
		/*
		///<summary>
		/// Fill an VList&lt;VwBlagajnaIzvjestajSaldo&gt; From a DataSet
		///</summary>
		/// <param name="dataSet">the DataSet</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Start row</param>
		/// <param name="pagelen">number of row.</param>
		///<returns><see chref="VList&lt;VwBlagajnaIzvjestajSaldo&gt;"/></returns>
		protected static VList&lt;VwBlagajnaIzvjestajSaldo&gt; Fill(DataSet dataSet, VList<VwBlagajnaIzvjestajSaldo> rows, int start, int pagelen)
		{
			if (dataSet.Tables.Count == 1)
			{
				return Fill(dataSet.Tables[0], rows, start, pagelen);
			}
			else
			{
				return new VList<VwBlagajnaIzvjestajSaldo>();
			}	
		}
		
		
		///<summary>
		/// Fill an VList&lt;VwBlagajnaIzvjestajSaldo&gt; From a DataTable
		///</summary>
		/// <param name="dataTable">the DataTable that hold the data.</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Start row</param>
		/// <param name="pagelen">number of row.</param>
		///<returns><see chref="VList<VwBlagajnaIzvjestajSaldo>"/></returns>
		protected static VList&lt;VwBlagajnaIzvjestajSaldo&gt; Fill(DataTable dataTable, VList<VwBlagajnaIzvjestajSaldo> rows, int start, int pagelen)
		{
			int recordnum = 0;
			
			System.Collections.IEnumerator dataRows =  dataTable.Rows.GetEnumerator();
			
			while (dataRows.MoveNext() && (pagelen != 0))
			{
				if(recordnum >= start)
				{
					DataRow row = (DataRow)dataRows.Current;
				
					VwBlagajnaIzvjestajSaldo c = new VwBlagajnaIzvjestajSaldo();
					c.ID = (Convert.IsDBNull(row["ID"]))?(int)0:(System.Int32)row["ID"];
					c.DatumOd = (Convert.IsDBNull(row["DatumOd"]))?DateTime.MinValue:(System.DateTime)row["DatumOd"];
					c.DatumDo = (Convert.IsDBNull(row["DatumDo"]))?DateTime.MinValue:(System.DateTime)row["DatumDo"];
					c.IDBlagajna = (Convert.IsDBNull(row["IDBlagajna"]))?(int)0:(System.Int32)row["IDBlagajna"];
					c.IDUser = (Convert.IsDBNull(row["IDUser"]))?(int)0:(System.Int32)row["IDUser"];
					c.IDKnjizenje = (Convert.IsDBNull(row["IDKnjizenje"]))?(int)0:(System.Int32?)row["IDKnjizenje"];
					c.Naziv = (Convert.IsDBNull(row["Naziv"]))?string.Empty:(System.String)row["Naziv"];
					c.KontoBlagajna = (Convert.IsDBNull(row["KontoBlagajna"]))?string.Empty:(System.String)row["KontoBlagajna"];
					c.UlazIzvjestaja = (Convert.IsDBNull(row["UlazIzvjestaja"]))?0:(System.Decimal)row["UlazIzvjestaja"];
					c.IzlazIzvjestaja = (Convert.IsDBNull(row["IzlazIzvjestaja"]))?0:(System.Decimal)row["IzlazIzvjestaja"];
					c.RedniBrojIzvjestaja = (Convert.IsDBNull(row["RedniBrojIzvjestaja"]))?(long)0:(System.Int64?)row["RedniBrojIzvjestaja"];
					c.BrojStavaka = (Convert.IsDBNull(row["BrojStavaka"]))?(int)0:(System.Int32)row["BrojStavaka"];
					c.PocetnoStanje = (Convert.IsDBNull(row["PocetnoStanje"]))?0:(System.Decimal?)row["PocetnoStanje"];
					c.SaldoIzvjestaja = (Convert.IsDBNull(row["SaldoIzvjestaja"]))?0:(System.Decimal)row["SaldoIzvjestaja"];
					c.Saldo = (Convert.IsDBNull(row["Saldo"]))?0:(System.Decimal?)row["Saldo"];
					c.IDProknjizeno = (Convert.IsDBNull(row["IDProknjizeno"]))?(int)0:(System.Int32?)row["IDProknjizeno"];
					c.AcceptChanges();
					rows.Add(c);
					pagelen -= 1;
				}
				recordnum += 1;
			}
			return rows;
		}
		*/	
						
		///<summary>
		/// Fill an <see cref="VList&lt;VwBlagajnaIzvjestajSaldo&gt;"/> From a DataReader.
		///</summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Start row</param>
		/// <param name="pageLength">number of row.</param>
		///<returns>a <see cref="VList&lt;VwBlagajnaIzvjestajSaldo&gt;"/></returns>
		protected VList<VwBlagajnaIzvjestajSaldo> Fill(IDataReader reader, VList<VwBlagajnaIzvjestajSaldo> rows, int start, int pageLength)
		{
			int recordnum = 0;
			while (reader.Read() && (pageLength != 0))
			{
				if(recordnum >= start)
				{
					VwBlagajnaIzvjestajSaldo entity = null;
					if (DataRepository.Provider.UseEntityFactory)
					{
						entity = EntityManager.CreateViewEntity<VwBlagajnaIzvjestajSaldo>("VwBlagajnaIzvjestajSaldo",  DataRepository.Provider.EntityCreationalFactoryType); 
					}
					else
					{
						entity = new VwBlagajnaIzvjestajSaldo();
					}
					entity.ID = (System.Int32)reader["ID"];
					//entity.ID = (Convert.IsDBNull(reader["ID"]))?(int)0:(System.Int32)reader["ID"];
					entity.DatumOd = (System.DateTime)reader["DatumOd"];
					//entity.DatumOd = (Convert.IsDBNull(reader["DatumOd"]))?DateTime.MinValue:(System.DateTime)reader["DatumOd"];
					entity.DatumDo = (System.DateTime)reader["DatumDo"];
					//entity.DatumDo = (Convert.IsDBNull(reader["DatumDo"]))?DateTime.MinValue:(System.DateTime)reader["DatumDo"];
					entity.IDBlagajna = (System.Int32)reader["IDBlagajna"];
					//entity.IDBlagajna = (Convert.IsDBNull(reader["IDBlagajna"]))?(int)0:(System.Int32)reader["IDBlagajna"];
					entity.IDUser = (System.Int32)reader["IDUser"];
					//entity.IDUser = (Convert.IsDBNull(reader["IDUser"]))?(int)0:(System.Int32)reader["IDUser"];
					entity.IDKnjizenje = reader.IsDBNull(reader.GetOrdinal("IDKnjizenje")) ? null : (System.Int32?)reader["IDKnjizenje"];
					//entity.IDKnjizenje = (Convert.IsDBNull(reader["IDKnjizenje"]))?(int)0:(System.Int32?)reader["IDKnjizenje"];
					entity.Naziv = (System.String)reader["Naziv"];
					//entity.Naziv = (Convert.IsDBNull(reader["Naziv"]))?string.Empty:(System.String)reader["Naziv"];
					entity.KontoBlagajna = (System.String)reader["KontoBlagajna"];
					//entity.KontoBlagajna = (Convert.IsDBNull(reader["KontoBlagajna"]))?string.Empty:(System.String)reader["KontoBlagajna"];
					entity.UlazIzvjestaja = (System.Decimal)reader["UlazIzvjestaja"];
					//entity.UlazIzvjestaja = (Convert.IsDBNull(reader["UlazIzvjestaja"]))?0:(System.Decimal)reader["UlazIzvjestaja"];
					entity.IzlazIzvjestaja = (System.Decimal)reader["IzlazIzvjestaja"];
					//entity.IzlazIzvjestaja = (Convert.IsDBNull(reader["IzlazIzvjestaja"]))?0:(System.Decimal)reader["IzlazIzvjestaja"];
					entity.RedniBrojIzvjestaja = reader.IsDBNull(reader.GetOrdinal("RedniBrojIzvjestaja")) ? null : (System.Int64?)reader["RedniBrojIzvjestaja"];
					//entity.RedniBrojIzvjestaja = (Convert.IsDBNull(reader["RedniBrojIzvjestaja"]))?(long)0:(System.Int64?)reader["RedniBrojIzvjestaja"];
					entity.BrojStavaka = (System.Int32)reader["BrojStavaka"];
					//entity.BrojStavaka = (Convert.IsDBNull(reader["BrojStavaka"]))?(int)0:(System.Int32)reader["BrojStavaka"];
					entity.PocetnoStanje = reader.IsDBNull(reader.GetOrdinal("PocetnoStanje")) ? null : (System.Decimal?)reader["PocetnoStanje"];
					//entity.PocetnoStanje = (Convert.IsDBNull(reader["PocetnoStanje"]))?0:(System.Decimal?)reader["PocetnoStanje"];
					entity.SaldoIzvjestaja = (System.Decimal)reader["SaldoIzvjestaja"];
					//entity.SaldoIzvjestaja = (Convert.IsDBNull(reader["SaldoIzvjestaja"]))?0:(System.Decimal)reader["SaldoIzvjestaja"];
					entity.Saldo = reader.IsDBNull(reader.GetOrdinal("Saldo")) ? null : (System.Decimal?)reader["Saldo"];
					//entity.Saldo = (Convert.IsDBNull(reader["Saldo"]))?0:(System.Decimal?)reader["Saldo"];
					entity.IDProknjizeno = reader.IsDBNull(reader.GetOrdinal("IDProknjizeno")) ? null : (System.Int32?)reader["IDProknjizeno"];
					//entity.IDProknjizeno = (Convert.IsDBNull(reader["IDProknjizeno"]))?(int)0:(System.Int32?)reader["IDProknjizeno"];
					entity.AcceptChanges();
					rows.Add(entity);
					pageLength -= 1;
				}
				recordnum += 1;
			}
			return rows;
		}
		
		
		/// <summary>
		/// Refreshes the <see cref="VwBlagajnaIzvjestajSaldo"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="VwBlagajnaIzvjestajSaldo"/> object to refresh.</param>
		protected void RefreshEntity(IDataReader reader, VwBlagajnaIzvjestajSaldo entity)
		{
			reader.Read();
			entity.ID = (System.Int32)reader["ID"];
			//entity.ID = (Convert.IsDBNull(reader["ID"]))?(int)0:(System.Int32)reader["ID"];
			entity.DatumOd = (System.DateTime)reader["DatumOd"];
			//entity.DatumOd = (Convert.IsDBNull(reader["DatumOd"]))?DateTime.MinValue:(System.DateTime)reader["DatumOd"];
			entity.DatumDo = (System.DateTime)reader["DatumDo"];
			//entity.DatumDo = (Convert.IsDBNull(reader["DatumDo"]))?DateTime.MinValue:(System.DateTime)reader["DatumDo"];
			entity.IDBlagajna = (System.Int32)reader["IDBlagajna"];
			//entity.IDBlagajna = (Convert.IsDBNull(reader["IDBlagajna"]))?(int)0:(System.Int32)reader["IDBlagajna"];
			entity.IDUser = (System.Int32)reader["IDUser"];
			//entity.IDUser = (Convert.IsDBNull(reader["IDUser"]))?(int)0:(System.Int32)reader["IDUser"];
			entity.IDKnjizenje = reader.IsDBNull(reader.GetOrdinal("IDKnjizenje")) ? null : (System.Int32?)reader["IDKnjizenje"];
			//entity.IDKnjizenje = (Convert.IsDBNull(reader["IDKnjizenje"]))?(int)0:(System.Int32?)reader["IDKnjizenje"];
			entity.Naziv = (System.String)reader["Naziv"];
			//entity.Naziv = (Convert.IsDBNull(reader["Naziv"]))?string.Empty:(System.String)reader["Naziv"];
			entity.KontoBlagajna = (System.String)reader["KontoBlagajna"];
			//entity.KontoBlagajna = (Convert.IsDBNull(reader["KontoBlagajna"]))?string.Empty:(System.String)reader["KontoBlagajna"];
			entity.UlazIzvjestaja = (System.Decimal)reader["UlazIzvjestaja"];
			//entity.UlazIzvjestaja = (Convert.IsDBNull(reader["UlazIzvjestaja"]))?0:(System.Decimal)reader["UlazIzvjestaja"];
			entity.IzlazIzvjestaja = (System.Decimal)reader["IzlazIzvjestaja"];
			//entity.IzlazIzvjestaja = (Convert.IsDBNull(reader["IzlazIzvjestaja"]))?0:(System.Decimal)reader["IzlazIzvjestaja"];
			entity.RedniBrojIzvjestaja = reader.IsDBNull(reader.GetOrdinal("RedniBrojIzvjestaja")) ? null : (System.Int64?)reader["RedniBrojIzvjestaja"];
			//entity.RedniBrojIzvjestaja = (Convert.IsDBNull(reader["RedniBrojIzvjestaja"]))?(long)0:(System.Int64?)reader["RedniBrojIzvjestaja"];
			entity.BrojStavaka = (System.Int32)reader["BrojStavaka"];
			//entity.BrojStavaka = (Convert.IsDBNull(reader["BrojStavaka"]))?(int)0:(System.Int32)reader["BrojStavaka"];
			entity.PocetnoStanje = reader.IsDBNull(reader.GetOrdinal("PocetnoStanje")) ? null : (System.Decimal?)reader["PocetnoStanje"];
			//entity.PocetnoStanje = (Convert.IsDBNull(reader["PocetnoStanje"]))?0:(System.Decimal?)reader["PocetnoStanje"];
			entity.SaldoIzvjestaja = (System.Decimal)reader["SaldoIzvjestaja"];
			//entity.SaldoIzvjestaja = (Convert.IsDBNull(reader["SaldoIzvjestaja"]))?0:(System.Decimal)reader["SaldoIzvjestaja"];
			entity.Saldo = reader.IsDBNull(reader.GetOrdinal("Saldo")) ? null : (System.Decimal?)reader["Saldo"];
			//entity.Saldo = (Convert.IsDBNull(reader["Saldo"]))?0:(System.Decimal?)reader["Saldo"];
			entity.IDProknjizeno = reader.IsDBNull(reader.GetOrdinal("IDProknjizeno")) ? null : (System.Int32?)reader["IDProknjizeno"];
			//entity.IDProknjizeno = (Convert.IsDBNull(reader["IDProknjizeno"]))?(int)0:(System.Int32?)reader["IDProknjizeno"];
			reader.Close();
	
			entity.AcceptChanges();
		}
		
		/*
		/// <summary>
		/// Refreshes the <see cref="VwBlagajnaIzvjestajSaldo"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="VwBlagajnaIzvjestajSaldo"/> object.</param>
		protected static void RefreshEntity(DataSet dataSet, VwBlagajnaIzvjestajSaldo entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.ID = (Convert.IsDBNull(dataRow["ID"]))?(int)0:(System.Int32)dataRow["ID"];
			entity.DatumOd = (Convert.IsDBNull(dataRow["DatumOd"]))?DateTime.MinValue:(System.DateTime)dataRow["DatumOd"];
			entity.DatumDo = (Convert.IsDBNull(dataRow["DatumDo"]))?DateTime.MinValue:(System.DateTime)dataRow["DatumDo"];
			entity.IDBlagajna = (Convert.IsDBNull(dataRow["IDBlagajna"]))?(int)0:(System.Int32)dataRow["IDBlagajna"];
			entity.IDUser = (Convert.IsDBNull(dataRow["IDUser"]))?(int)0:(System.Int32)dataRow["IDUser"];
			entity.IDKnjizenje = (Convert.IsDBNull(dataRow["IDKnjizenje"]))?(int)0:(System.Int32?)dataRow["IDKnjizenje"];
			entity.Naziv = (Convert.IsDBNull(dataRow["Naziv"]))?string.Empty:(System.String)dataRow["Naziv"];
			entity.KontoBlagajna = (Convert.IsDBNull(dataRow["KontoBlagajna"]))?string.Empty:(System.String)dataRow["KontoBlagajna"];
			entity.UlazIzvjestaja = (Convert.IsDBNull(dataRow["UlazIzvjestaja"]))?0:(System.Decimal)dataRow["UlazIzvjestaja"];
			entity.IzlazIzvjestaja = (Convert.IsDBNull(dataRow["IzlazIzvjestaja"]))?0:(System.Decimal)dataRow["IzlazIzvjestaja"];
			entity.RedniBrojIzvjestaja = (Convert.IsDBNull(dataRow["RedniBrojIzvjestaja"]))?(long)0:(System.Int64?)dataRow["RedniBrojIzvjestaja"];
			entity.BrojStavaka = (Convert.IsDBNull(dataRow["BrojStavaka"]))?(int)0:(System.Int32)dataRow["BrojStavaka"];
			entity.PocetnoStanje = (Convert.IsDBNull(dataRow["PocetnoStanje"]))?0:(System.Decimal?)dataRow["PocetnoStanje"];
			entity.SaldoIzvjestaja = (Convert.IsDBNull(dataRow["SaldoIzvjestaja"]))?0:(System.Decimal)dataRow["SaldoIzvjestaja"];
			entity.Saldo = (Convert.IsDBNull(dataRow["Saldo"]))?0:(System.Decimal?)dataRow["Saldo"];
			entity.IDProknjizeno = (Convert.IsDBNull(dataRow["IDProknjizeno"]))?(int)0:(System.Int32?)dataRow["IDProknjizeno"];
			entity.AcceptChanges();
		}
		*/
			
		#endregion Helper Functions
	}//end class

	#region VwBlagajnaIzvjestajSaldoFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VwBlagajnaIzvjestajSaldo"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VwBlagajnaIzvjestajSaldoFilterBuilder : SqlFilterBuilder<VwBlagajnaIzvjestajSaldoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VwBlagajnaIzvjestajSaldoFilterBuilder class.
		/// </summary>
		public VwBlagajnaIzvjestajSaldoFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the VwBlagajnaIzvjestajSaldoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public VwBlagajnaIzvjestajSaldoFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the VwBlagajnaIzvjestajSaldoFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public VwBlagajnaIzvjestajSaldoFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion VwBlagajnaIzvjestajSaldoFilterBuilder

	#region VwBlagajnaIzvjestajSaldoParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VwBlagajnaIzvjestajSaldo"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VwBlagajnaIzvjestajSaldoParameterBuilder : ParameterizedSqlFilterBuilder<VwBlagajnaIzvjestajSaldoColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VwBlagajnaIzvjestajSaldoParameterBuilder class.
		/// </summary>
		public VwBlagajnaIzvjestajSaldoParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the VwBlagajnaIzvjestajSaldoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public VwBlagajnaIzvjestajSaldoParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the VwBlagajnaIzvjestajSaldoParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public VwBlagajnaIzvjestajSaldoParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion VwBlagajnaIzvjestajSaldoParameterBuilder
} // end namespace
